package com;

public class American implements Person{
    private String name;
    private int age;
    private Person chi;
    public American(){
        System.out.println("Ame空参");
    };

    public American(String name) {
        this.name = name;
    }

    public American(int age) {
        this.age = age;
    }

    public American(String name, int age, Chinese chi) {
        this.name = name;
        this.age = age;
        this.chi = chi;
        System.out.println("A全参");
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setChi(Chinese p) {
        System.out.println("用了set方法");
        this.chi = p;
    }

    public void eat(){
        System.out.println(1);
    }

    @Override
    public String toString() {
        return "American{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", chi=" + chi +
                '}';
    }
}
